<!DOCTYPE html >
<html xmlns:th="http://www.thymeleaf.org">
<title>销量爆款</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<meta name="format-detection" content="telephone=no" >
<meta name="apple-touch-fullscreen" content="yes">
<link rel="shortcut icon" href="/images/favicon.ico"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link th:href="@{/css/taoke.css}"  rel="stylesheet"/>
<script type="text/javascript" th:src="@{/js/taoke.js}"></script>
<script type="text/javascript" th:src="@{/js/jquery.js}"></script>
<script type="text/javascript" th:src="@{/js/function.js}"></script>
</head>

<body>
<div class="jiange10"><form class="srhf" method="get" action="/index/search"><div class="wrap"><input type="text" placeholder="请输入你所需要的商品" name="k" value="" class="srh"></div><div class="sbt"><input type="submit" name="submit" value="搜索商品" ></div><div class="clearinput2"></div></form></div>
<div class="splist_div">

    <ul th:each="p:${proList}">
        <li class="splist">
            <a  th:href= "@{'/product/'+${p.pid}}">
                <div class="listimg"><img   th:src="${p.proimg}" src="http://img.alicdn.com/tfscom/i2/3489934895/TB1ekDKjtzJ8KJjSspkXXbF7VXa_!!0-item_pic.jpg_200x200q50.jpg"></div>
                <div class="listh4"><img src="/images/cat.jpg" class="h4biao"><h4 th:text="${p.pname}"></h4><span class="jia_before" th:text="${p.oldprice}">39.9元</span><div class="jia_after">
                    <span>券后</span><em th:text="${p.price}">19.90</em><em > 元</em></div><span class="fbiao1">已售<em th:text="${p.sales}">29905</em></span>p<span class="sy"></span></div></a>
            <div class="quan"><span class="quan_span1">优惠券</span><p th:text="${p.couponcode}" ></p><a href="/view/561089734124" class="quan_span2">领券购买</a></div>
        </li>
    </ul>

    <a id="pagebtn" style="text-align: center;width:100%;color:#ccc; display:block;background-color: #FFFFFF;padding-top: 8px;">正在加载...</a>
</div>
<div class="cheng"></div>
<div class="footer">
    <div class="ftrbtn"><a href="/index"><img src="/images/chaoshigray.png"><span>新品上架</span></a></div>
    <!--<div class="ftrbtn"><a href=""><img src="/images/zang.png"><span>人气推荐</span></a></div>-->
    <div class="ftrbtn"><a href="/jingxuan"><img src="/images/zangred.png"><span class="red">每日精选</span></a></div>
    <div class="ftrbtn naviconlg"><a href="/search"><div></div><span>超级搜索</span></a></div>
    <div class="ftrbtn"><a href="/tejia"><img src="/images/9gray.png"><span >20封顶</span></a></div>
    <div class="ftrbtn"><a href="/baokuan"><img src="/images/firegray.png"><span>销量爆款</span></a></div>

</div>
<div id="gotop"><img src="/images/top.svg"></div>
<div id="mas"><img src="/images/mas.png"></div>
<div id="layerma"><div class="layerblack" id="layerblack"></div><div class="layerma1"><span class="ma-title">长按二维码收藏</span>
    <img src="/images/qrcode.jpg" class="ma1"><span class="matext">官方公众号</span></div></div>
<div style="display:none;">
    <img src="http://c.cnzz.com/wapstat.php?siteid=1261232671&r=http%3A%2F%2Fxb.hitaoke.com%2Findex%2Fsale&rnd=1752676389" width="0" height="0"/>
</div>
<script type="text/javascript" th:src="@{/js/taoke.js}"></script>
<script>
addLoadEvent(gotop);
addLoadEvent(closeTips);
addLoadEvent(openMa);
</script><script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>

<script>
wx.config({
    debug: false,
    appId: 'wxd7cfad8c3c20c2ba',
    timestamp: 1517920311,
    nonceStr: 'UPqm3dFXovIhVZAJ',
    signature: '5964974c1ead1075f061c5b26906d866de6b6a4c',
    jsApiList: [
        'onMenuShareTimeline',
        'onMenuShareAppMessage'
    ]
});
wx.ready(function () {
    var shareData = {
        title: '点击领取优惠券',
        desc: '加入【小宝淘券】-优惠券大全，领内部优惠券，超嗨优惠购物体验！',
        link: location.href.split('#')[0],
        imgUrl: 'http://img.hitaoke.com/video/2017/12/15124038627609.jpg'
    };
    wx.onMenuShareAppMessage(shareData);
    wx.onMenuShareTimeline(shareData);
});
</script>

<script>
    $(document).ready(function(){

        var srhVal = $(".srh").val();
        if($.trim(srhVal).length>0){
            $(".clearinput2").css("display","inline-block");
            $(".clearinput2").show();
        }
        $(".srh").on('input porpertychange',function(){
            $(".clearinput2").css("display","inline-block");
            $(".clearinput2").show();
        });
        $(".clearinput2").click(function(){
            $(".srh").val("");
            $(this).hide();
        });

        var pageBtn = '<a id="pagebtn" style="text-align: center;color:#ccc;width:100%; display:block;background-color: #FFFFFF;padding-top: 8px;">正在加载...</a>';
        //分页、更新
        var page = 2,updClock = true,clock = true,total = 866;
        var pageName = 'index_page_';

        var data;
        var html = '';
        $(window).scroll(function(){
            var t = $(this).scrollTop(), h = $(this).height(), dh = $(document).height();
            //滚动分页
            if(((t + h) > (dh - 1)) && clock) {
                var pageBtnObj = $("#pagebtn");
                if(page>=total){
                    pageBtnObj.remove();
                    return;
                }
                clock = false;
                var data = false;
                if (typeof(Storage) !== "undefined") {
                    data = sessionStorage.getItem(pageName+page);
                }
                $.getJSON('/jingxuanList/'+page,function(data){
                    if(data.products){
                        page++;
                        var html = '';
                        html += pageBtn;
                        $.each(data.products,function(index,v){
                            html += loadHtml(v);
                        });

                        $(".splist:last").after(html);
                        clock = true;
                    }
                });
            }
        });
    });
    function loadHtml(v){
        html='<li class="splist"><a href="/product/'+v.pid+'"><div class="listimg"><img src="'+ v.proimg+'"></div><div class="listh4"><img src="/images/'+(v.usertype=='1'?'cat':'tao')+'.jpg" class="h4biao"><h4>'+ v.pname+'</h4><span class="jia_before">'+ (v.oldprice*1)+'元</span><div class="jia_after"><span>券后</span><em>'+ v.price+'元</em></div><span class="fbiao1">已售<em>'+ v.sales+'</em></span><span class="sy">销量'+ v.sales+'件</span></div></a><div class="quan"><span class="quan_span1">优惠券</span><p>'+ parseInt(v.couponcode)+'</p><a href="/view/'+v.pid+'" class="quan_span2">领券购买</a></div></li>';
        return html;
    }
</script>
</body>
</html>